package com.tianji.learning.service;

import com.tianji.common.domain.dto.PageDTO;
import com.tianji.common.domain.query.PageQuery;
import com.tianji.learning.domain.dto.LearningPlanDTO;
import com.tianji.learning.domain.po.LearningLesson;
import com.baomidou.mybatisplus.extension.service.IService;
import com.tianji.learning.domain.vo.LearningLessonVO;
import com.tianji.learning.domain.vo.LearningPlanPageVO;
import com.tianji.learning.domain.vo.LearningPlanVO;

import java.util.List;

/**
 * <p>
 * 学生课程表 服务类
 * </p>
 *
 * @author zhongweiwei
 * @since 2023-05-24
 */
public interface ILearningLessonService extends IService<LearningLesson> {
    /**
     * 支付成功后加入课表
     * @param userId
     * @param courseIds
     */
    void addlesson(Long userId, List<Long> courseIds);

    /**
     * 分页查询我的课表
     * @param query
     * @return
     */
    PageDTO<LearningLessonVO> queryMyLessons(PageQuery query);

    /**
     * 查询我正在学习的课程
     *
     * @return
     */
    LearningLessonVO queryMyCurrentLesson();

    /**
     * 查询指定课程的信息
     * @param courseId
     * @return
     */
    LearningLessonVO queryLessonByCourseId(Long courseId);
    /**
     * 删除指定的课程
     * @param userId
     * @param courseId
     */
    void deleteCourseFromLesson(Long userId, Long courseId);

    /**
     * 校验当前课程是否报名
     * @param courseId
     * @return
     */
    Long isLessonValid(Long courseId);

    /**
     *
     * 统计课程学习人数
     * @param courseId
     * @return
     */
    Integer countLearningLessonByCourse(Long courseId);

    /**
     * 创建学习计划
     * @param plan
     */
    void addLearningPlan(LearningPlanDTO plan);
    /**
     * 根据用户id和coursedid查询课程
     * @param userId
     * @param courseId
     */

    LearningLesson queryLessonByUserIdorCourseid(Long userId, Long courseId);

    /**
     * 查询学习计划
     * @param query
     * @return
     */
    LearningPlanPageVO queryLearningPlan(PageQuery query);
}
